<template>
  <div>
    <button @click='$emit("ageAdd", "param")'>父组件年龄+1</button>
    子组件接收到的age:{{subAge}}
    <div>state.counter:{{ $store.state.subStore.counter}}</div>
    <button @click="$store.dispatch('subStore/aIncrement')">加</button>
    <button @click="aDecrement">减</button>
  </div>

</template>

<script>
  import {mapActions} from 'vuex'
  export default {
    name: 'subHello',
    props:['subAge'],
    methods:{
      ...mapActions('subStore',['aIncrement','aDecrement'])
    }
  }
</script>

<style scoped>

</style>
